﻿@{
    string action = ViewContext.RouteData.Values["action"].ToString().ToLower();
    var nav = NavService.Find(action);

    string title = nav?["title"].ToString();
    string remark = nav?["remark"]?.ToString() ?? title;
    string icon = nav?["icon"].ToString();

    //仅body主体
    var onlybody = "ps".Split(',');

    //无导航
    var nonav = "wallpaper,contact".Split(',');

    var isbh = CacheTo.Get(GlobalTo.GetValue("Common:BuildHtmlKey")) as bool? ?? false;
}
@Html.Raw(Netnr.SharedApp.QuoteTo.Html("the"))
<!DOCTYPE html>
<html>
<head>

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    @Html.Raw(Netnr.SharedApp.QuoteTo.Html("favicon"))

    <title>@Html.Raw(title) 脚本服务</title>

    <meta name="keywords" content="netnr NET牛人 @Html.Raw(title)" />
    <meta name="description" content="Script Services @Html.Raw(remark)" />

</head>
<body>
    @if (onlybody.Contains(action))
    {
        @RenderBody()
    }
    else
    {
        @Html.Raw(Netnr.SharedApp.QuoteTo.Html("loading,bootstrap.css,fa.css,jquery.js,bootstrap.js,jz.js,netnrnav.css,netnrnav.js,ss-icon"))
        <link href="/css/global.css" rel="stylesheet" asp-append-version="true" />
        <script src="/js/global.js" asp-append-version="true"></script>

        @if (!nonav.Contains(action))
        {
            <!--导航-->
            <button type="button" class="MenuToggle show-in-mobile btn btn-primary ml-3 mt-3">
                <span class="fa fa-align-justify fa-2x"></span>
            </button>
            <div class="netnrnav horizontal">
                <div class="netnrnav-wrapper">
                    <ul>
                        <li><a href="https://www.netnr.com" class="siteIcon"><img src="/favicon.svg" /> 首页</a></li>
                        <li><a href="https://www.netnr.com/gist/discover" title="代码片段"><span class="fa fa-fw fa-file-code-o"></span> Gist</a></li>
                        <li><a href="https://www.netnr.com/run/discover" title="在线运行代码"><span class="fa fa-fw fa-play"></span> Run</a></li>
                        <li><a href="https://www.netnr.com/doc" title="文档管理"><span class="fa fa-fw fa-book"></span> Doc</a></li>
                        <li><a href="https://www.netnr.com/draw/discover" title="绘制"><span class="fa fa-fw fa-paint-brush"></span> Draw</a></li>
                        <li><a href="/" title="ss.js.org"><span class="fa fa-fw fa-wrench"></span> 服务</a></li>
                        <li style="background-image: radial-gradient(ellipse, white, rgb(227, 248, 240))">
                            <!--标题-->
                            @if (action != "index")
                            {
                                <a href='javascript:location.reload(false)' title="@Html.Raw(remark)">
                                    <svg class="titleicon"><use xlink:href="#@icon"></use></svg> @title
                                </a>
                            }
                        </li>
                        <li>
                            <a class="text-muted"><span class="fa fa-fw fa-ellipsis-h"></span></a>
                            <ul>
                                <li><a target="_blank" title="码云" href="https://gitee.com/netnr"><i class="fa fa-fw fa-git"></i> Gitee <sup><i class="fa small fa-external-link"></i></sup></a></li>
                                <li><a target="_blank" title="GitHub" href="https://github.com/netnr"><i class="fa fa-fw fa-github"></i> GitHub <sup><i class="fa small fa-external-link"></i></sup></a></li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        }

        <div class="min300 mt-3">
            @RenderBody()
        </div>

        <a href="javascript:ss.toTop();" class="totop" title="返回顶部">ˆ</a>
    }
</body>
</html>